import { _decorator, Component, Node, EventTouch, tween, v3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Setting')
export class Setting extends Component {
    start() {

    }

    update(deltaTime: number) {

    }
    /**返回主页 */
    BacktoMain() {
        this.node.setPosition(v3(600));
    }
    /**更改设置 */
    ChangeSetting(e: EventTouch) {
        const node = e.target.children[0];
        const { x = -30 } = node.position
        if (x < 0) {
            tween(node).by(0.1, { position: v3(60) }).start();
        }
        else {
            tween(node).by(0.1, { position: v3(-60) }).start();
        }
    }
}

